package org.mendoza.salud.hvt.model.seguridad;

import org.mendoza.salud.hvt.model.AbstractEntity;
import org.mendoza.salud.hvt.model.personal.Empleado;
import org.mendoza.salud.hvt.model.personal.Servicio;

import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import javax.persistence.OneToOne;
import java.util.Set;

/**
 * Created by ricardo on 12/08/14.
 */

@Entity
public class Usuario extends AbstractEntity {
    private String name;
    private String password;
    @OneToOne
    private Empleado empleado;
    @ManyToMany
    private Set<Servicio> servicios;

    public Usuario() {
    }

    public Usuario(String name, String password, Empleado empleado) {
        this.name = name;
        this.password = password;
        this.empleado = empleado;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Empleado getEmpleado() {
        return empleado;
    }

    public void setEmpleado(Empleado empleado) {
        this.empleado = empleado;
    }


    @Override
    public String toString() {
        return "Usuario{" +
                "name='" + name + '\'' +
                '}';
    }
}
